<div class="row">
    <div class="col-lg-12">
        <div class="portlet box">
            <div class="portlet-header">
                <div class="caption">User Listing</div>
                <div class="actions">
                    <a href="<?php echo $this->url('admin/user/create' , array('action' => 'create'));?>" class="btn btn-info btn-xs">
                        <i class="fa fa-plus"></i>&nbsp;Thêm user
                    </a>
                    <div class="btn-group">
                        <a href="#" data-toggle="dropdown" class="btn btn-warning btn-xs dropdown-toggle">
                            <i class="fa fa-wrench"></i>&nbsp;
                            Tools
                        </a>
                        <ul class="dropdown-menu pull-right">
                            <li><a href="#">Export to Excel</a></li>
                            <li><a href="#">Export to CSV</a></li>
                            <li><a href="#">Export to XML</a></li>
                            <li class="divider"></li>
                            <li><a href="#">Print Invoices</a></li>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="portlet-body">
                <div class="row mbm">
                    <div class="col-lg-12">
                        <div style="display: none;" class="alert alert-danger tb-alert-error">
                            <button type="button" data-dismiss="alert" aria-hidden="true" class="close">×</button>
                            Lorem ipsum dolor sit amet, consectetur adipiscing elit.
                        </div>
                        <div style="display: none" class="alert alert-success tb-alert-success">
                            <button type="button" data-dismiss="alert" aria-hidden="true" class="close">×</button>
                            Lorem ipsum dolor sit amet, consectetur adipiscing elit.
                        </div>
                    </div>
                </div>

                <div class="row mbm">
                    <div class="col-lg-6">
                        <div class="tb-group-actions pull-right"><span>10 records selected:</span>
                            <select class="table-group-action-select form-control input-inline input-small input-sm mlm">
                                <option value="0">Select...</option>
                                <option value="1">Cancel</option>
                                <option value="2">Hold</option>
                                <option value="3">On Hold</option>
                                <option value="4">Close</option>
                            </select>&nbsp;
                            <button class="btn btn-sm btn-primary submit-action">
                                <i class="fa fa-check"></i>&nbsp;
                                Submit
                            </button>
                        </div>
                    </div>
                    <div class="col-lg-6 text-right">
                        <?php
                        echo $this->paginationControl(
                        // the paginator object
                            $this->paginator,
                            // the scrolling style; see
                            'sliding',
                            // the partial to use to render the control
                            //array('layout/backend/paginator/paginator.phtml', 'Admin'),                                        '
                            array('skin/backend/µAdmin/paginator', 'users'),
                            // the route to link to when a user clicks a control link
                            array(
                                'route' => 'admin/user'
                            )
                        );
                        ?>
                    </div>
                </div>
                <table class="table table-hover table-striped table-bordered table-advanced tablesorter">
                    <thead>
                    <tr role="row">
                        <th class="header">
                            ID
                        </th>
                        <th class="header">
                            <i class="gi gi-user"></i>
                        </th>
                        <th class="header">
                            Client
                        </th>
                        <th class="header">
                            Email
                        </th>
                        <th class="header">
                            Role
                        </th>
                        <th class="header">
                            Date created
                        </th>
                        <th class="header">
                            Staus
                        </th>
                        <th class="header">
                            Actions
                        </th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php foreach($this->users as $user): ?>
                        <tr role="row" class="odd">
                            <td class="center">
                                <?php echo $user->getUserId();?>
                            </td>
                            <td class="text-center">
                                <?php if($user->getAvatar()): ?>
                                    <img src="/ZendApplication/data/uploads/<?php echo $user->getAvatar()->getImagePath();?>" alt="avatar" class="img-circle" width="32" height="32">
                                <?php endif; ?>
                            </td>
                            <td>
                                <?php echo $user->getFirstname() . ' ' . $user->getLastName();?>
                            </td>
                            <td>
                                <a href="#">
                                    <?php echo $user->getEmail();?>
                                </a>
                            </td>
                            <td>
                                <?php echo $user->getRoleId() ? $user->getRoleId()->getRoleId() : ''; ?>
                            </td>
                            <td>
                                <?php echo date('d/m/Y',$user->getCreatedOn());?>
                            </td>
                            <td>
                                <?php echo $user->getActive() ?: 'Bị khóa';?>
                            </td>
                            <td class="text-center">
                                <div>
                                    <a href="<?php echo $this->url('admin/user/update' , array('id' => $user->getUserId()));?>" data-toggle="tooltip" title="" class="btn btn-default btn-xs" data-original-title="Edit">
                                        <i class="fa fa-pencil"></i>
                                        Edit
                                    </a>
                                    &nbsp;&nbsp;
                                    <a onclick="if(!confirm('Bạn có chắc xóa không?')){return false;};" href="<?php echo $this->url('admin/user/delete' , array('id' => $user->getUserId()));?>" data-toggle="tooltip" title="" class="btn btn-danger btn-xs" data-original-title="Delete">
                                        <i class="fa fa-times"></i>
                                        Delete
                                    </a>
                                </div>
                            </td>
                        </tr>
                    <?php endforeach; ?>
                </table>
                <div class="row mbm">
                    <div class="col-lg-6 text-left">
                        <div class="tb-group-actions pull-right"><span>10 records selected:</span>
                            <select class="table-group-action-select form-control input-inline input-small input-sm mlm">
                                <option value="0">Select...</option>
                                <option value="1">Cancel</option>
                                <option value="2">Hold</option>
                                <option value="3">On Hold</option>
                                <option value="4">Close</option>
                            </select>&nbsp;
                            <button class="btn btn-sm btn-primary submit-action">
                                <i class="fa fa-check"></i>&nbsp;
                                Submit
                            </button>
                        </div>
                    </div>
                    <div class="col-lg-6 text-right">
                        <?php
                        echo $this->paginationControl(
                        // the paginator object
                            $this->paginator,
                            // the scrolling style; see
                            'sliding',
                            // the partial to use to render the control
                            //array('layout/backend/paginator/paginator.phtml', 'Admin'),                                        '
                            array('skin/backend/µAdmin/paginator', 'users'),
                            // the route to link to when a user clicks a control link
                            array(
                                'route' => 'admin/user'
                            )
                        );
                        ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>